package com.ay7.service;

import com.ay7.DTO.CartDTO;
import com.ay7.entity.ProductInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 商品详情服务接口
 * Created by wenjul
 * on 18/3/25 0025 13:00
 */
public interface ProductInfoService {

    ProductInfo findOne(String productId);


    /*查询所有商品（在架）*/
    List<ProductInfo> findUpAll();

    Page<ProductInfo> findAll(Pageable pageable);

    /*保存商品*/
    ProductInfo save(ProductInfo productInfo);

    /*加库存*/
    void increaseStock(List<CartDTO> cartDTOList);

    /*减库存*/
    void decreaseStock(List<CartDTO> cartDTOList);

    //上架
    ProductInfo onSale(String productId);

    //下架
    ProductInfo offSale(String productId);

}
